<template>
  <div class="main">
    <div class="summOut">
      <scrollerEdit lock-x>
        <div class="ouerImgWrap">
          <span class="posBack" v-hide @click="backToPrev">
            <i class="posImg"></i>
          </span>
          <img class="summImg" src="https://static.shengxue985.com/sxzx_app/h5/activity/sycp-home.jpg" alt />
          <div style="height: 1.5rem;"></div>
        </div>
      </scrollerEdit>
      <div>
        <div @click="flag = !flag">1234522</div>
        
        <Popup v-model="flag">
          <PopupHeader left-text='取消' right-text='确定' title='选择'>
          </PopupHeader>
            <div>1</div>
            <div>2</div>
            <div>3</div>
            <div>4</div>
        </Popup>
      </div>
      <div class="create-btn">
        <span @click="gotos">进入生涯测评</span>
      </div>
    </div>
  </div>
</template>
<script>
import ls from 'store2'
import { PopupHeader,Popup  } from 'vux'
import scrollerEdit from '~/components/scrollerEdit'
import { getReportList } from '~/api/evaluation'
import { identityLogin } from '~/api/identity'
import { backAppOrWx } from '~/common/common'
export default {
  head: {
    title: '生涯测评',
  },
  components: {
    scrollerEdit,
    PopupHeader,
    Popup
  },
  data() {
    return {
      flag:false,
      isShowModal: false,
      toke: '',
      surplus: 0,
    }
  },
  //   created() {
  //     this.commonJs.accectAppParame()
  //   },
  mounted: function() {
    // this.$vux.loading.show({
    //  text: 'Loading'
    // })
    this.$visit(this.$route.path)
  },

  watch: {},
  methods: {
    //查看卡劵是否生成方案
    loginVers(data) {
      identityLogin(data)
        .then((res) => {
          if (res.code === '0') {
            let usersData = res.data
            ls.set('yxkData', usersData)
            ls.set('userType', usersData.userType)
            ls.set('tokensyxk', usersData.accessToken)
            this.isShowModal = false
            this.$vux.toast.text('服务授权成功')
          } else {
            this.$vux.toast.text(res.message)
          }
        })
        .catch((error) => {
          this.$vux.toast.text(error)
        })
    },
    backToPrev() {
      backAppOrWx()
    },

    goTeaIndexUrl() {
      let abc = window.location.href

      this.jumpUrl = decodeURIComponent(this.commonJs.GetUrlParam('tea_return_url'))
      if (this.jumpUrl) {
        ls.set('jumpsTeaUrl', this.jumpUrl)
        let datas = this.commonJs.GetUrlParam('tea_userData')
        let usersData = JSON.parse(decodeURIComponent(datas))
        ls.set('yxkData', usersData)
        ls.set('userType', usersData.userType)
        ls.set('tokensyxk', usersData.accessToken)
      }
    },

    getReportList() {
      this.$loading('open')
      let userid = ls.get('yxkData').userId * 1
      ls.set('userId', userid)
      getReportList(ls.get('userType'))
        .then((res) => {
          if (res.code === '0') {
            let length = res.data.length

            if (length) {
              this.commonJs.gopush('reportRecord')
            } else {
              this.commonJs.gopush('evaluationEntry')
            }
          }
          this.$hideLoading()
        })
        .catch((error) => {
          this.$vux.toast.text(error)
          this.$hideLoading()
        })
    },
    gotos() {
      ls.set('preUrl', '../evaluation/ad')
      this.getReportList()
    },
  },
  beforeDestroy() {},
}
</script>

<style scoped lang="less">
.create-btn {
  position: fixed;
  width: 100%;
  left: 0;
  bottom: 0;
  height: auto;
  background: rgba(255, 255, 255, 1);
  box-shadow: 0px -0.04rem 0.1rem 0px rgba(204, 204, 204, 0.2);
  span {
    display: block;
    margin: 0.2rem auto;
    width: 6rem;
    height: 0.88rem;
    background: @mainColor;
    border-radius: 0.44rem;
    text-align: center;
    line-height: 0.88rem;
    font-size: 0.3rem;
    font-family: PingFangSC;
    font-weight: 600;
    color: rgba(255, 255, 255, 1);
  }
}
.ouerImgWrap {
  width: 7.5rem;
  height: auto;
  position: relative;

  .posBack {
    position: absolute;
    width: 0.8rem;
    height: 0.8rem;
    left: 0.2rem;
    top: 0.2rem;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 50%;

    .posImg {
      display: block;
      width: 0.4rem;
      height: 0.4rem;
      margin: 0.2rem auto;
      background: url('~@/static/sprite/icon_sprites_40.png') -0.7rem -0.1rem;
      background-size: 3rem 2.4rem;
    }
  }
}

.fixadBot {
  width: 7.5rem;
  overflow: hidden;
  position: fixed;
  height: 1.5rem;
  max-height: 2rem;
  bottom: 0rem;
  z-index: 100;

  span {
    display: block;
    width: 3.2rem;
    height: 0.8rem;
    background: @mainColor;
    border-radius: 0.1rem;
    font-size: 0.36rem;

    font-weight: 600;
    color: rgba(255, 255, 255, 1);
    line-height: 0.8rem;
    text-align: center;
    margin: 0.2rem auto 0.2rem;
  }
}

.summOut {
  width: 7.5rem;
  height: auto;
  min-height: 16.24rem;
  background: #fff;
}

.summImg {
  display: block;
  width: 100%;
  height: auto;
  min-height: 16.24rem;
}
</style>
